package frist50;

import org.junit.jupiter.api.Test;

public class T0026 {
    public int removeDuplicates(int[] nums) {
        int num=nums[0];
        int left=1;
        for (int i = 1; i < nums.length; i++) {
            if (nums[i]>num){
                num=nums[i];
                nums[left]=num;
                left++;
            }
        }
        return left;
    }

    @Test
    public void test() {

        int [] ints={1,2,2,3};
        System.out.println(removeDuplicates(ints));

    }
}
